package Bit;

/**
 * @Classname JZ56数组数字的出现的次数
 * @Description TODO
 * @Date 2023/2/19 11:54
 * @Created by xjl
 */
public class JZ56数组数字的出现的次数 {

    public int singleNumber(int[] nums) {
        int ones = 0, twos = 0;
        for (int num : nums) {
            ones = ones ^ num & ~twos;
            twos = twos ^ num & ~ones;
        }
        return ones;
    }
}
